
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>安装 · Gitbook demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        <meta name="author" content="lanyue">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="intro.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <a target="_blank" href="https://github.com/vuejs/vuex/tree/1.0/docs">
            
                    
                    寻找 1.0 文档？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <a target="_blank" href="https://github.com/vuejs/vuex/releases">
            
                    
                    更新记录
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4" data-path="installation.html">
            
                <a href="installation.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="intro.html">
            
                <a href="intro.html">
            
                    
                    Vuex 是什么？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="getting-started.html">
            
                <a href="getting-started.html">
            
                    
                    开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    核心概念
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="state.html">
            
                <a href="state.html">
            
                    
                    State
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="getters.html">
            
                <a href="getters.html">
            
                    
                    Getters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="mutations.html">
            
                <a href="mutations.html">
            
                    
                    Mutations
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="actions.html">
            
                <a href="actions.html">
            
                    
                    Actions
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="modules.html">
            
                <a href="modules.html">
            
                    
                    Modules
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="structure.html">
            
                <a href="structure.html">
            
                    
                    项目结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="plugins.html">
            
                <a href="plugins.html">
            
                    
                    插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="strict.html">
            
                <a href="strict.html">
            
                    
                    严格模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="forms.html">
            
                <a href="forms.html">
            
                    
                    表单处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="testing.html">
            
                <a href="testing.html">
            
                    
                    测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="hot-reload.html">
            
                <a href="hot-reload.html">
            
                    
                    热重载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="api.html">
            
                <a href="api.html">
            
                    
                    API 文档
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >安装</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5B89;&#x88C5;">&#x5B89;&#x88C5;</h1>
<h3 id="&#x76F4;&#x63A5;&#x4E0B;&#x8F7D;--cdn-&#x5F15;&#x7528;">&#x76F4;&#x63A5;&#x4E0B;&#x8F7D; / CDN &#x5F15;&#x7528;</h3>
<p><a href="https://unpkg.com/vuex" target="_blank">https://unpkg.com/vuex</a></p>
<!--email_off-->
<p><a href="https://unpkg.com" target="_blank">Unpkg.com</a> &#x63D0;&#x4F9B;&#x4E86;&#x57FA;&#x4E8E; NPM &#x7684; CDN &#x94FE;&#x63A5;&#x3002;&#x4EE5;&#x4E0A;&#x7684;&#x94FE;&#x63A5;&#x4F1A;&#x4E00;&#x76F4;&#x6307;&#x5411; NPM &#x4E0A;&#x53D1;&#x5E03;&#x7684;&#x6700;&#x65B0;&#x7248;&#x672C;&#x3002;&#x60A8;&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>https://unpkg.com/vuex@2.0.0</code> &#x8FD9;&#x6837;&#x7684;&#x65B9;&#x5F0F;&#x6307;&#x5B9A;&#x7279;&#x5B9A;&#x7684;&#x7248;&#x672C;&#x3002;
<!--/email_off--></p>
<p>&#x5728; Vue &#x4E4B;&#x540E;&#x5F15;&#x5165; <code>vuex</code> &#x4F1A;&#x8FDB;&#x884C;&#x81EA;&#x52A8;&#x5B89;&#x88C5;&#xFF1A;</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;/path/to/vue.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;/path/to/vuex.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
</code></pre>
<h3 id="npm">NPM</h3>
<pre><code class="lang-bash">npm install vuex --save
</code></pre>
<h3 id="yarn">Yarn</h3>
<pre><code class="lang-bash">yarn add vuex
</code></pre>
<p>&#x5728;&#x4E00;&#x4E2A;&#x6A21;&#x5757;&#x5316;&#x7684;&#x6253;&#x5305;&#x7CFB;&#x7EDF;&#x4E2D;&#xFF0C;&#x60A8;&#x5FC5;&#x987B;&#x663E;&#x5F0F;&#x5730;&#x901A;&#x8FC7; <code>Vue.use()</code> &#x6765;&#x5B89;&#x88C5; Vuex&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> Vue <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;vue&apos;</span>
<span class="hljs-keyword">import</span> Vuex <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;vuex&apos;</span>

Vue.use(Vuex)
</code></pre>
<p>&#x5F53;&#x4F7F;&#x7528;&#x5168;&#x5C40; script &#x6807;&#x7B7E;&#x5F15;&#x7528; Vuex &#x65F6;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x4EE5;&#x4E0A;&#x5B89;&#x88C5;&#x8FC7;&#x7A0B;&#x3002;</p>
<h3 id="&#x81EA;&#x5DF1;&#x6784;&#x5EFA;">&#x81EA;&#x5DF1;&#x6784;&#x5EFA;</h3>
<p>&#x5982;&#x679C;&#x9700;&#x8981;&#x4F7F;&#x7528; dev &#x5206;&#x652F;&#x4E0B;&#x7684;&#x6700;&#x65B0;&#x7248;&#x672C;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4ECE; GitHub &#x4E0A;&#x514B;&#x9686;&#x4EE3;&#x7801;&#x5E76;&#x81EA;&#x5DF1;&#x6784;&#x5EFA;&#x3002;</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">clone</span> https://github.com/vuejs/vuex.git node_modules/vuex
<span class="hljs-built_in">cd</span> node_modules/vuex
npm install
npm run build
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="intro.html" class="navigation navigation-next navigation-unique" aria-label="Next page: Vuex 是什么？">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"安装","level":"1.4","depth":1,"next":{"title":"Vuex 是什么？","level":"1.5","depth":1,"path":"intro.md","ref":"intro.md","articles":[]},"previous":{"title":"更新记录","level":"1.3","depth":1,"url":"https://github.com/vuejs/vuex/releases","ref":"https://github.com/vuejs/vuex/releases","articles":[]},"dir":"ltr"},"config":{"plugins":[],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"lanyue","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Gitbook demo","language":"zh-hans","gitbook":">=3.0.0","description":"this is a test"},"file":{"path":"installation.md","mtime":"2017-02-21T09:41:56.410Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-06T15:58:45.473Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

